{% extends "base.html" %}

{% block content %}
Welcome! Here are the current twitter trends.

<script type="text/javascript">
	function linkClicked(theid) {
		var item = document.getElementById(theid);
		console.log(item)
		item.innerHTML += " (loading)"
	}
</script>

<div id="trends">
<ol>
	{% for trend in trends %}
	<li id="trend{{forloop.counter}}"><a href="/topic/?q={{trend|urlencode}}" onClick="linkClicked(trend{{forloop.counter}})">{{ trend }}</a></li>
	{% endfor %}
</ol>
</div>

<h2>Search for a topic:</h2>
<form action="/topic/" method="get">
<input type="text" name="q">
<input type="submit" value="Submit" />
</form>

<script type="text/javascript">
function load() {}
</script>
{% endblock %}